package com.ehome.poct.core.api.feign;

import com.ehome.core.page.Page;
import com.ehome.poct.core.api.dto.DelReportDTO;
import com.ehome.poct.core.api.dto.ReportListDTO;
import com.ehome.poct.core.api.dto.ReportQry;
import com.ehome.poct.core.api.dto.check.BldCheckReportVO;
import com.ehome.poct.core.api.dto.check.CheckReportDTO;
import com.ehome.poct.core.api.dto.check.ProjectNameReportDTO;
import com.ehome.poct.core.api.dto.check.ReportDTO;
import com.ehome.poct.core.api.dto.report.ReportRequestDTO;
import com.ehome.poct.core.api.dto.report.TestReportConfigDTO;
import com.ehome.poct.core.api.vo.CheckReportVO;
import com.ehome.poct.core.api.vo.ReportDetailVO;
import com.ehome.poct.core.api.vo.ReportDtlVO;
import com.ehome.poct.core.api.vo.ReportListVO;
import com.ehome.poct.core.api.vo.report.H5ReportDetailVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: 报告信息feign调用
 * @author: muqiu
 * @time: 2022/3/3 17:23
 */
@FeignClient(value = "${service.poct-core:}${service.suffix.poct-core:}", path ="/report",  contextId = "ReportClient")
public interface ReportClient {
    /**
     * 查询报告列表
     * @param dto
     * @return
     */
    @PostMapping("/list")
    List<ReportListVO> getCheckList(@RequestBody ReportListDTO dto);

    /**
     * 根据订单号查询报告详情
     * @param orderNo
     * @return
     */
    @GetMapping("/by/order/{orderNo}")
    ReportDetailVO getCheckReportByOrderNo(@PathVariable String orderNo);

    /**
     * 根据报告ID查询报告详情
     * @param reportId
     * @return
     */
    @GetMapping("/by/id/{reportId}")
    ReportDetailVO getCheckReport(@PathVariable Long reportId);

    @GetMapping("/page")
    Page<CheckReportVO> page(@SpringQueryMap ReportQry reportQry);

    @PostMapping(value = "/bld/{dataId}/{orderNo}/{isPay}")
    BldCheckReportVO createByDataId(@PathVariable Long dataId, @PathVariable String orderNo,@PathVariable Boolean isPay);

    @PostMapping("/jby/list")
    Page<CheckReportVO> pageJby(ReportQry reportQry);

    /**
     * 血常规检测报告删除
     * @param id
     */
    @DeleteMapping("/del/bld/{id}")
    void deleteBld(@PathVariable(value = "id") Long id);

    /**
     * 金标仪
     * @param delReportDTO
     */
    @DeleteMapping("/del/jby")
    void deleteJby(@RequestBody DelReportDTO delReportDTO);

    /**
     * 金标仪单项检测详情
     * @param id
     * @return
     */
    @GetMapping("/getSingleDetail/{id}")
    ReportDtlVO getSingleOne(@PathVariable Long id);

    /**
     * 金标仪联测检测详情
     * @param id
     * @return
     */
    @GetMapping("/getUnionDetail/{id}")
    ReportDtlVO getUnionOne(@PathVariable(value = "id") Long id);


    @GetMapping("/h5/bld/{orderNo}")
    H5ReportDetailVO getH5BldDtlByOrderNo(@PathVariable String orderNo);

    @GetMapping("/h5/ol/jby/{id}")
    H5ReportDetailVO getH5OLDtlByJbyId(@PathVariable Long id);

    @GetMapping(value = "/notify/url/{reportId}/{type}")
    String getNotifyUrl(@PathVariable Long reportId, @PathVariable Integer type);
    @PostMapping("/updateReportStatus/{orderNo}")
    void updateReportStatus(@PathVariable String orderNo);

    /**
     * 报告组成
     * @param reportRequestDTO
     * @return
     */
    @PostMapping(value = "/jby/createReport")
    void createReport(@RequestBody ReportRequestDTO reportRequestDTO);

    /**
     * 查询金标仪报告组成
     * @param orderNo
     * @return
     */
    @GetMapping(value = "/jby/getSummaryJby/{orderNo}")
    List<ReportDTO> getSummaryJby(@PathVariable String orderNo);

    @GetMapping
    List<CheckReportVO> getSummaryBld(@SpringQueryMap CheckReportDTO checkReportDTO);

    /**
     * 金标仪报告隐藏
     * @param testReportConfigDTO
     */
    @PostMapping(value = "/jby/reportConfigJby")
    void reportConfigJby(@RequestBody TestReportConfigDTO testReportConfigDTO);
    /**
     * 血常规报告隐藏
     * @param testReportConfigDTO
     */
    @PostMapping(value = "/bld/reportConfigBld")
    void reportConfigBld(@RequestBody TestReportConfigDTO testReportConfigDTO);

    /**
     * 根据订单号获取简单报表信息
     * @param orderNo
     * @return
     */
    @GetMapping(value = "/list/{orderNo}")
    List<ReportDTO> simpleReportList(@PathVariable String orderNo);


    /**
     * 根据订单号获取检测项目
     * @param orderNos
     * @return
     */
    @PostMapping(value = "/projectNameList")
    List<ProjectNameReportDTO> projectNameList(@RequestBody List<String> orderNos);

}
